<form name="frmQuery">
<md-card>
	<md-card-title>
		<md-card-title-text>
           <span class="md-headline">{{ page.isnew ? '新增' : page.item.name }}</span>
         </md-card-title-text>
	</md-card-title>
	<md-card-content layout="column">
		
		<md-input-container>
			<label>名称</label>
	        <input md-maxlength="30" required md-no-asterisk name="name" ng-model="page.item.name" />
	        <div ng-messages="frmQuery.name.$error">
	          <div ng-message="required">必填项</div>
	          <div ng-message="md-maxlength">最长30个字符</div>
	        </div>
		</md-input-container>
		<md-input-container>
			<label>数据源</label>
	        <md-select ng-model="page.item.connid">
	            <md-option ng-repeat="conn in page.connections" ng-value="conn.connid">{{conn.name}}</md-option>
	        </md-select>
		</md-input-container>
		<md-input-container>
			<label>查询语句</label>
	        <textarea ng-model="page.item.sql" md-maxlength="1000" rows="5" name="sql" md-select-on-focus></textarea>
	        <div ng-messages="frmQuery.sql.$error">
	          <div ng-message="required">必填项</div>
	          <div ng-message="md-maxlength">最长1000个字符</div>
	        </div>
		</md-input-container>
		<md-input-container>
			<label>描述</label>
	        <textarea ng-model="page.item.desc" md-maxlength="1000" rows="5" name="desc" md-select-on-focus></textarea>
	        <div ng-messages="frmQuery.desc.$error">
	          <div ng-message="required">必填项</div>
	          <div ng-message="md-maxlength">最长1000个字符</div>
	        </div>
		</md-input-container>
	</md-card-content>
	<md-card-action>
		<md-button class="md-primary md-raised" ng-click="page.save()">
			<md-icon md-font-icon="fa fa-save"></md-icon>
			保存
		</md-button>
		<md-button class="md-primary md-raised" ng-click="page.test()">
			<md-icon md-font-icon="fa fa-play"></md-icon>
			测试
		</md-button>
		<md-button class="md-raised" ui-sref="query">
			<md-icon md-font-icon="fa fa-undo"></md-icon>
			返回
		</md-button>
	</md-card-action>
</md-card>
</form>